home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 16
/
Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso
/
Aminet
/
comm
/
tcp
/
AwebGetE_mailv.lha
/
awebgetmailv1.1
/
rexx
/
GetMail.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-10-24
|
3KB
|
117 lines
/* GetMail ARexx script for AWeb
Version 1.1
By Jeff Dettman (tomeeee@soho.ios.com)
Description:
------------
This script can be used to poll your POPHost for mail and will
display the results under AWeb (have mail, here it is; have no mail;
AmiTCP isn't running)
Requires:
---------
GetMail3.lha from comm/tcp
Notes:
------
This script is set up to automatically delete the mail from your
POPHost server. If you wish to change this, remove the word
'delete' from the command parameters on line 43
*/
/* change these options for your account */
/* optional if using AmiTCP and AmiTCP login name is the SAME as POPHost login name */
user = 'your_user_name' /*e.g user = 'tomeeee'*/
/* Manditory to get mail from POPHost */
password = 'yourpassword'
/* optional if AmiTCP has entry for POPHost in AmiTCP:db/hosts */
/* see getmail.doc for information on this topic */
pophost = 'your_pophost'
/* optional but recommended */
emailaddr = 'your_email_adress'
/* internal use, don't modify the following */
home = 'T:'
mailfile = 'GetMail.tempfile'
/* MAIN SCRIPT */
/*options results*/
address command
'c:GetMail user='user 'password='password 'pophost='pophost 'home='home 'mail='mailfile 'delete'
if rc ~= 20 then do
if exists('T:GetMail.tempfile') then do
address command 'rx trimmail.rexx'
end
if ~exists('T:GetMail.tempfile') then do
address command 'echo >T:GetMail.HaveNone "<HTML><HEAD><TITLE>Mail Message</TITLE></HEAD><BODY><H1>Mail Message</H1>"'
'echo >>T:GetMail.HaveNone "<HR><PRE>Sorry, no mail was found at this time</PRE><HR>"'
/* Load the temp file into AWeb.
Use the RELOAD switch to force the file to be reloaded */
address AWEB.1 'open file://localhost/t:GetMail.HaveNone reload'
address command 'delete t:GetMail.HaveNone'
'delete t:GetMail.HaveSome'
exit
end
end
if rc = 20 then do
address command
'echo >T:AmiTCP.notrunning "<HTML><HEAD><TITLE>ERROR!</TITLE></HEAD><PRE>"'
'echo >>T:AmiTCP.notrunning "<BODY><H1>AmiTCP is required to be running</H1>"'
/* Load the temp file into AWeb.
Use the RELOAD switch to force the file to be reloaded*/
address AWEB.1 'open file://localhost/t:AmiTCP.notrunning reload'
address command 'delete t:AmiTCP.notrunning'
exit
end
else do
/* Load the temp file into AWeb.
Use the RELOAD switch to force the file to be reloaded */
call ht
address AWEB.1 'open file://localhost/t:from.html reload'
end
/* address command 'delete t:GetMail.HaveSome'*/
/* address command 'delete t:Getmail.HaveSome'*/
exit
end
return 0
ht:
open(p1,'t:from.html',w)
open(3,'T:GetMail1.temp',r)
a=0
call writeln(p1,"<HTML><HEAD><TITLE>E-Mail Messages</TITLE></HEAD><BODY><H1>E-Mail Messages</H1>")
call writeln(p1,"<HR><PRE>You have the following message(s) from:")
call writeln(p1,"")
call writeln(p1,"")
call writeln(p1,'<ul>')
Do until eof(3)
a=a+1
line=readln(3)
call writeln(p1,'<li><a href=message.'a'>'compress(line,'<,>')'</a>')
end
call writeln(p1,"</PRE><HR>")
call writeln(p1,"<A href=x-aweb:rexx/delete.rexx>Delete Messages</A> <A href=x-aweb:rexx/save.rexx>Save Messages</A>")
close(p1)
return 0